def scan(str):
	direction=['north', 'south', 'east', 'west', 'down', 'up', 'left', 'right', 'back']
	verb=['go', 'stop', 'kill', 'eat']
	stop=['the', 'in', 'of', 'from', 'at', 'it']
	noun=['door', 'bear', 'princess', 'cabinet']
	glossary = [direction,verb,stop,noun]
	names = ['direction','verb','stop','noun']

	index={}
	for x in glossary:
		for y in x:
			index.update({y:names[glossary.index(x)]})

	output = []
	words = str.split()
	for name in words:
		key=index.get(name)
		if name.isdigit():
			output.append(('number',int(name)))
		elif key != None: 
				output.append((index.get(name),name))
		else:
				output.append(('error',name))
	return output

